package com.erp.model.groupuser
{
	import com.adobe.cairngorm.CairngormError;
	import com.adobe.cairngorm.CairngormMessageCodes;
	import com.adobe.cairngorm.model.ModelLocator;
	import com.erp.control.BaseEvent;

	import flash.events.Event;

	import mx.collections.ArrayCollection;

	//绑定全局View数据
	[Bindable]
	public class GroupUserModelLocator implements ModelLocator
	{

		//树
		private var _groupUserTree:ArrayCollection;
		//右侧画布控制
		private var _selectChildName:String;


		private static var instance:GroupUserModelLocator;

		//单例模式
		public function GroupUserModelLocator()
		{
			if (instance == !null)
			{
				throw new CairngormError(CairngormMessageCodes.SINGLETON_EXCEPTION, "GroupUserModelLocator");
			}
			instance=this;
		}

		public static function getInstance():GroupUserModelLocator
		{
			if (instance == null)
			{
				instance=new GroupUserModelLocator();
			}
			return instance;
		}

		public function changeStack(selectChild:String):void
		{
			this.selectChildName=selectChild;
			dispatchEvent(new Event(BaseEvent.GROUP_USER_CHANGE_STACK));
		}

		//----------------------------------------------------------------------------------------------------

		public function get groupUserTree():ArrayCollection
		{
			return _groupUserTree;
		}

		public function set groupUserTree(value:ArrayCollection):void
		{
			_groupUserTree=value;
		}

		public function get selectChildName():String
		{
			return _selectChildName;
		}

		public function set selectChildName(value:String):void
		{
			_selectChildName=value;
		}


	}
}